//
//  ShopCarOHeaderView.m
//  CenturyCity
//
//  Created by beisheng03 on 2017/12/11.
//  Copyright © 2017年 beisheng. All rights reserved.
//

#import "ShopCarOHeaderView.h"
#import "ShopCarController.h"

@interface ShopCarOHeaderView ()
@property (weak, nonatomic) IBOutlet UIButton *leftBtn;

@property (weak, nonatomic) IBOutlet UILabel *rihtLable;
@property (weak, nonatomic) IBOutlet UIView *bottomLineView;
@property (weak, nonatomic) IBOutlet UIView *bgView;

@end

@implementation ShopCarOHeaderView

- (void)awakeFromNib{
    
    [super awakeFromNib];
//    self.contentView.backgroundColor = viewBgGrey;
    
    self.bgView.backgroundColor = colorWith(236, 236, 236);
    
    self.leftBtn.imageEdgeInsets = UIEdgeInsetsMake(10, 10, 10, 10);

    self.rihtLable.textColor = [UIColor colorWithHexString:@"666666"];
    
    self.rihtLable.font = MYFONT(15);
    
//    self.bottomLineView.backgroundColor = [UIColor colorWithHexString:@"e2e2e2"];
    
    self.bottomLineView.backgroundColor = [UIColor whiteColor];
}

- (void)setModel:(GoodsSetionModel *)model{
    _model = model;
    
    if ([@"1" isEqualToString:model.checked]) {
        
        self.leftBtn.selected = YES;
    }
    else if ([@"0" isEqualToString:model.checked])
    {
        self.leftBtn.selected = NO;
    }
    
    
    self.rihtLable.text = model.store_name;

}

- (IBAction)leftBtnDidTap:(UIButton *)sender {
    
    ShopCarController *controller = (ShopCarController *)self.viewController;
    
    [controller didClickSectionBtn:sender withSection:self.setion];
    
}


@end
